require 'yaml'
require 'sequel'

# 连接数据库
DB = Sequel.connect(YAML.load_file("config/database.yml")[ENV["RACK_ENV"] || "development"])

# ----------------------------------------------------
# 可以通过以下命令初始化数据库表结构
# sequel -m db/migrations config/database.yml
# ----------------------------------------------------
Sequel.extension :migration
Sequel::Migrator.run(DB, "db/migrations", :use_transactions=>true)
